package spark

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Spark_1 {
  def main(args: Array[String]): Unit = {
    //1.创建SparkConfig对象
    val config: SparkConf = new SparkConf().setMaster("local[*]").setAppName("WordCount")
    //2.创建Spark上下文对象
    val sc = new SparkContext(config)


    val listRDD: RDD[Int] = sc.makeRDD(List(1,2,3,4))
    listRDD.collect().foreach(println)
    println(listRDD.collect().mkString(","))
  }
}
